Recommended Practice:
OBP-TFTP extension
Version: 0.5 Unapproved DRAFT
Published by the Open Firmware Working Group
April 23, 1996
The Open Firmware Working Group is involved both in IEEE sanctioned standards activities, whose final results are published by IEEE, and in informal recommendations such as this, which are published on the Internet at:
http://playground.sun.com/1275
Membership in the Open Firmware Working Group is open to all interested parties. The working group meets at regular intervals at various locations. For more information send email to:
p1275-wg@risc.sps.mot.com
Revision History
The specifications contained herein are based upon RFCs (Request For Comments) published by the Internet Engineering Task Force and existing practice in Open Firmware implementations.
[2] RFC 1350, TFTP Revision 2, published by IETF.
[3] RFC 951, Bootstrap Protocol (BOOTP), published by IETF.
[4] RFC 768, User Datagram Protocol, published by IETF.
[5] RFC 1542, Clarifications and Extensions for the Bootstrap Protocol, published by IETF.
[6] RFC 826, An Ethernet Address Resolution Protocol, published by IETF.
[7] RFC 792, Internet Control Message Protocol, published by IETF.
The BOOTP protocol ([3]) is an IETF standard that defines a mechanism by which a booting device that does not know "anything" can locate a server, determine its proper IP address and identify the appropriate file that can be loaded.
BOOTP allows for a range of system knowledge to be used in the process. At one extreme, the booting device knows nothing except for its network hardware address (e.g., its 6-byte EtherNet address). At the other end of the spectrum, the booting device can know the server's IP address, its own IP address, any gateway necessary, etc. The open method arguments described below allow the user (via command-line and/or boot-device arguments) to specify the various pieces of knowledge.
This document will refer to several fields within the BOOTP protocol's packet format. These fields are:
op1=BOOTREQUEST, 2= BOOTREPLY
ciaddrclient's IP address (the booting system)
yiaddr'your' (i.e., client) IP address (filled in by server)
siaddrserver's IP address
giaddr'gateway' IP address
chaddrclient's hardware address
fileboot file name
Note: this document does not go into complete details of the BOOTP or TFTP protocols. For complete details, refer to [3] , [5] and [2].
The client then broadcasts (i.e., using a network-specific broadcast hardware address) the BOOTREQUEST packet. Potential servers examine the packet to determine if they should respond to the request. This is typically done by consulting a table, indexed by the chaddr field.
A server that determines that it should respond does so by creating a BOOTREPLY packet filling in the yiaddr field with the proper IP address of the client and the file field with the filename of the "boot-image" appropriate for the system and sending the packet to the client.
The client examines the BOOTREPLY packet and uses the yiaddr field as its IP address for subsequent transmissions and the siaddr field as the IP address of its client. It also uses the file field of the reply packet as the filename to be used for the TFTP request that it will generate.
At this point, the client may know all the information necessary to attempt to load the boot-image file. The one piece of information that is not explictly handled by the BOOTP protocol is obtaining the hardware address of the server. If the client can obtain the server's hardware address (HA) by access to the hardware header of the BOOTREPLY packet, then it can use that as the server's HA.
However, it may be necessary to use ARP ([6]) to map the IP address of the server to its HA.
Once it has obtained all of the relevant information about itself and its server, the client loads the boot-image. It starts this process by sending a TFTP read request (RRQ) packet, using the filename obtained from the BOOTREPLY packet. This RRQ packet is sent to the server at its proper HA and IP address obtained during the BOOTP process.
Assuming that the RRQ is successful, the server will reply with a TFTP DATA packet. The loading process then proceeds with a sequence of ACK replies sent by the client and DATA packets sent by the server. The process ends when the length field of a DATA packet is 0, indicating the the entire file has been sent.
Since UDP is not a reliable protocol, and since a server may not be found, the actual BOOTP (and, subsequent TFTP loading) process contains timeout and retry provisions that were ignored above so that the basic data flow could be simply described.
The description of the arguments for the open method of the obp-tftp package describe how these various alternatives can be specified.
Additional methods are defined within the obp-tftp package to report the values of BOOTP parameters that apply to an opened instance. These paramaters can be obtained by a "network" device and remembered (e.g., in static values) so that a Client program can obtain them later. An example of where this would be done is when a boot image has been loaded by the "network" device and that boot program needs to get back to the particular server for additional files.
The description of the ping user interface command and the ping methods in the "network" device and obp-tftp package show how this facility can be provided by an Open Firmware implementation.
siaddr,filename,ciaddr,giaddr,subnet-mask,bootp-retries,tftp-retries
The external format of the siaddr, ciaddr, giaddr and subnet-mask fields are in Internet-standard "dotted-decimal" notation.
siaddr is the IP address of the intended server. If this field is specified, its decoded value is used for as the siaddr field of the BOOTREQUEST packet (and subsequent TFTP packets). If this field is not specified, the value of 0.0.0.0 is used for the siaddr field of the BOOTREQUEST packet, and the server's IP address is determined by the siaddr of the BOOTREPLY packet. The server's IP address is saved so that it can be reported by the si-addr method.
filename is the filename of the file that is to be loaded by TFTP from the server. If specified, the file field of the BOOTREQUEST field is set from this field; if not specified, the file field is set to zero. Since this filename may be a "generic" name, the file field of the BOOTREPLY packet is used as the Filename field of the RRQ packet during the subsequent TFTP loading.
If the the filename is not specified or is not the string "%NONE%", the obp-tftp open method will attempt to initiate the reading of the file (as determined by the file field of the BOOTREPLY) by issuing a TFTP RRQ packet. If this succeeds, the file can be subsequently loaded, and the open will report success.
The special filename argumnent of "%NONE%" is used to specify that no TFTP process is to follow the open. This is used to open the obp-tftp package and obtain IP addresses, subnet-mask, etc., but without a TFTP RRQ packet. The purpose of this is so that methods other than load (e.g., ping) can be performed on the open instance of obp-tftp.
ciaddr is the IP address of the client (i.e., the system being booted). If this field is specified, its decoded value is used as the ciaddr field of the BOOTREQUEST packet (and, subsequent TFTP transactions); i.e., the yiaddr field of BOOTREPLY packets is ignored. If this field is not specified, the ciaddr field is set to 0.0.0.0 and the client's IP address is determined from the yiaddr field of the BOOTREPLY packet. (Note: this behavior is specified by [5].) In either case, the ciaddr that is being used by this instance shall be remembered and supplied as the result of a subsequent ci-addr call.
giaddr is the IP address of the BOOTP 'gateway'. (Note that this is not necessarily the same as the network gateway; see [3] and [5] for details.) If this field is specified, its decoded value is used as the value of the giaddr field of the BOOTREQUEST packet; if not specified, the giaddr field of the BOOTREQUEST packet is set to 0.0.0.0. The value that applies to the current instance is remembered and supplied as the result of the gi-addr call of this open instance.
subnet-mask is the subnet-mask to be used for this interface.
[[[Author's note: section on subnet-mask needs more work]]]
bootp-retries is the maximum number of retries that are attempted before the BOOTP process is determined to have failed. I.e., if, after bootp-retries attempts at transmission of a BOOTREQUEST packet are made with no responding BOOTREPLY packets are received, the obp-tftp package shall report failure by returning a non-zero value as its open result.
tftp-retries is the maximum number of retries that are attempted before the TFTP process is stopped. The retries count shall include timeouts and bad DATA packets. If the count is exceeded, the TFTP load method shall abort.
The ip-addr returned is the IP address to be used for this device.
The ip-addr returned is the IP address of the server.
The ip-addr returned is the IP address of the gateway. A value of 0.0.0.0 implys that no gateway is involved.
The value is the subnet-mask to be used.
The following call is used by a "network" device's ping method to attempt a single ping.
The msecs value is the time to wait (in millisecondss) after an ICMP echo request before reporting failure. The reply? result is true if a reply to the echo was seen, otherwise reply? is false.
"network-type"S
prop-name, standard property to report type of "network".
prop-encoded-array, a string, encoded as with encode-string, that is chosen from the following set: "enternet", "ethernet-802.3", "ethernet-fast", "token-ring".
prop-encode-array, a string, encoded as with encode-string, that is chosen from the following set: "aui", "bnc", "10baseT".
The following methods report the values that apply to the last use of the device. I.e., after using the device to load a boot image, these methods recall the BOOTP parameters that applied.
The ip-addr returned is the IP address to be used for this device. If ip-addr is 0, then the IP address of this interface has not yet been determined.
The ip-addr returned is the IP address of the server. If ip-addr is 0, then the IP address of the server not yet been determined.
The ip-addr returned is the IP address of the gateway. If ip-addr is 0, then the IP address of the gateway has not yet been.
The value is the subnet-mask to be used for this device. If the returned mask value is 0, then the subnet-mask has not yet been determined.
The following method is an entry to provide access to the obp-tftp package's ping support.
This method is a "pass-through". I.e., it shall open an instance of the obp-tftp package with a filename field of "%NONE%", using ip-addr as the siaddr and nattempts as the bootp-retries value. If the open fails, the nreplies return value is -1. If the open is successful, nattempts calls of the open obp-tftp instance's ping method are done, using msecs as the msecs argument. The number of successful attempts is kept track of. When all attempts have been made, the obp-tftp instance is closed and the number of successful attempts is reported.